#pragma once
#include <stdexcept>
namespace LxCFD
{
    struct ShallowArray
    {
    public:
        ShallowArray();
        ShallowArray(int length, int *array);
        void Reverse();
        inline int GetLengh() const { return _Length; }
        inline int *GetArray() const { return _Array; }
        inline int &operator[](int index) const { return this->_Array[index]; }
        inline int &at(int index) const
        {
            if (index < 0 || index >= _Length)
                throw std::out_of_range("out of range!");
            return this->_Array[index];
        }
        inline int *begin() const { return _Array; }
        inline int *end() const { return _Array + _Length; }

    private:
        int _Length = 0;
        int *_Array = nullptr;
    };
}